<% layout('/layouts/default.html', {title: '担保方查询', libs: ['validate','fileupload']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa icon-note"></i> ${text('担保方详情')}
                <% if (hasPermi('base:guarantor:edit')){ %>
                    <button type="button" class="btn btn-primary" id="editView">${text('编辑单据')}</button>
                <% } %>
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${guarantor}" action="${ctx}/base/guarantor/save" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">${text('基本信息')}</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('担保方编号')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:hidden path="isNewRecord"/>
							<#form:input id="guarantorId" path="guarantorId" maxlength="64" readonly="${!guarantor.isNewRecord}" class="form-control required" disabled="true"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('名称')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="guarantorName" maxlength="100" class="form-control required" disabled="true"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('身份证号')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="idNumber" maxlength="100" class="form-control" disabled="true"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('电话')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="phone" maxlength="100" class="form-control phone" disabled="true"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('邮箱')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="email" maxlength="100" class="form-control email" disabled="true"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('地址')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="address" maxlength="200" class="form-control" disabled="true"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('备注')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:textarea path="remarks" rows="4" maxlength="500" class="form-control" disabled="true"/>
							</div>
						</div>
					</div>
				</div>
                <div class="form-unit">${text('附件信息')}</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">
								<span class="required hide">*</span> ${text('附件上传')}：</label>
							<div class="col-sm-10">
								<#form:fileupload id="uploadFile" bizKey="${guarantor.id}" bizType="guarantor_file"
									uploadType="all" class="" readonly="true" preview="true"/>
							</div>
						</div>
					</div>
				</div>
			</div>
            <div class="form-unit">${text('系统信息')}</div>
        <div class="row">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-sm-4" title="">
                        <span class="required hide">*</span> ${text('创建日期')}：<i class="fa icon-question hide"></i></label>
                    <div class="col-sm-8">
                        <#form:input path="createDate" class="form-control" disabled="true"
                        dataFormat="datetime2" data-type="datetime" data-format="yyyy-MM-dd HH:mm:ss"/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-sm-4" title="">
                        <span class="required hide">*</span> ${text('创建人')}：<i class="fa icon-question hide"></i></label>
                    <div class="col-sm-8">
                        <!--<#form:input path="createBy" class="form-control" disabled="true"/>-->
                        <#form:select path="createBy" items="${listUser}" disabled="true"
                        itemLabel="userName" itemValue="userCode"  blankOption="true" class="form-control"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-sm-4" title="">
                        <span class="required hide">*</span> ${text('最后修改日期')}：<i class="fa icon-question hide"></i></label>
                    <div class="col-sm-8">
                        <#form:input path="updateDate" readonly="true" maxlength="20" class="form-control"
                        dataFormat="datetime2" data-type="datetime" data-format="yyyy-MM-dd HH:mm:ss"/>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="control-label col-sm-4" title="">
                        <span class="required hide">*</span> ${text('最后修改人')}：<i class="fa icon-question hide"></i></label>
                    <div class="col-sm-8">
                        <!--<#form:input path="updateBy" readonly="true" maxlength="20" class="form-control"/>-->
                        <#form:select path="updateBy" items="${listUser}" disabled="true"
                        itemLabel="userName" itemValue="userCode"  blankOption="true" class="form-control"/>
                    </div>
                </div>
            </div>
        </div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>

<script>
    $("#editView").click(function () {
        var id = $("#guarantorId").val();
        var URL = '${ctx}/base/guarantor/guarantor/form?guarantorId=' + id;
        window.location.href =URL;
    });
</script>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
</script>